package com.tbryant.test.redis.usagescenarios;

import com.tbryant.test.redis.RedisConstant;
import redis.clients.jedis.Jedis;

/**
 * 需要先启动Consumer，监听才有效
 *
 * @auther TBryant
 * @date 2021/5/28 11:12
 */
public class PubSubTestConsumer {
    private static final Jedis JEDIS = new Jedis(RedisConstant.REDIS_IP, RedisConstant.REDIS_PORT);

    public static void main(String[] args) {
        PubSubListener pubSubListener = new PubSubListener();
        JEDIS.subscribe(pubSubListener, RedisConstant.REDIS_TEST_PUBSUB_CHANNEL);
    }
}
